#ifndef _HW4_H
#define _HW4_H

#include "raster.h"

void find_unitVec(float* start, float* end, float* retval);
float findDist(float* start, float* end);

typedef struct {
	float c [ 3 ];					// x,y,z coordinates
} VERTEX;

typedef struct {
	ByteRaster* image;		// array of pointers to the images in combinations of r,g,b channels
	GLuint texture;			// array of textures associated with the images
	VERTEX v [ 4 ];						// vertices (4) of the polygon holding the picture
	VERTEX t [ 4 ];			
	GLuint color;  						// color channels to display. Used to index into the texture array.	
} PICTURE;

/* scene graph object */
typedef struct sg {
	VERTEX v [ 4 ];					// vertices of this particular plate
	float  rot;						// angle to rotate the plate at each time step
	float  curr_angle;				// current amount to rotate plate from parallel to X axis
} SG;

typedef struct {
	ByteRaster* img;
	float width;
	float height;
	float pos [ 4 ];
	GLuint tex;
} IMAGE;

extern SG scene [MAX_PLATES];			// Array of scene plates
extern int max_node;				 	// maximum node number
extern int selected_plate;				// index of plate that is currently selected
extern bool rotating;					// True if plates should be rotating
extern IMAGE image[2];			// array of pointers to the image files
extern bool use_shader;					// True if should be using the shader

#endif
